package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.DefDrill;
import com.ruoyi.system.domain.DefGain;
import com.ruoyi.system.domain.dto.OpenApiDTO;
import com.ruoyi.system.service.IDefDrillService;
import com.ruoyi.system.service.IDefGainService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/open/api")
public class OpenApiController extends BaseController {

    @Autowired
    private IDefDrillService defDrillService;

    @Autowired
    private IDefGainService defGainService;

    @GetMapping("/drill")
    public TableDataInfo drill(OpenApiDTO dto) {
        List<DefDrill> list = defDrillService.drill(dto);
        return getDataTable(list);
    }

    @GetMapping("/gain")
    public TableDataInfo gain(OpenApiDTO dto) {
        List<DefGain> list = defGainService.gain(dto);
        return getDataTable(list);
    }




}
